package mains;

import rangs.RangCarre;

public class Carre extends AbstractAnalyseurRang{
	public Carre() {
		super();
	}

	public boolean reconnaitreMain(ReqAnalyseMain requete) {
	  Main m = hasSameDenominationNTimes(requete.getMain(),4);
	  if(m != null){
		  RangCarre carre = new RangCarre();
		  carre.setCarre(m);
		  
		  Main reste = requete.getMain();
		  requete.getMain().removeAll(m);
		  carre.setReste(reste);

		  requete.setRangReconnu(carre);
		  return true; 
	  }
	  return false;
	}
	
	public RangPoker getRang() {
		return RangPoker.CARRE;
	}
}
